home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / doc / sigprc03 < prev    next >
Text File  |  1997-07-08  |  832b  |  28 lines

  1. ; This batch file creates a plot of the real and imaginary parts
  2. ; of the simulated signal used in the example from Chapter 13,
  3. ; "Signal Processing", of _Using IDL_.
  4.  
  5. @sigprc01.bat ; compute time data sequence u
  6.  
  7. V = FFT(U) ; compute spectrum v
  8.  
  9. M = (INDGEN(N)-(N/2-1)) ; m = [-(N/2-1), ... , -1, 0, 1, ... , N/2-1, N/2]
  10.  
  11. F = M / (N*delt)        ; frequencies corresponding to m in cycles/second
  12.  
  13. !P.MULTI = [0, 1, 2] ; set up for two plots in window
  14.  
  15. PLOT, F, FLOAT(SHIFT(V,N/2-1)), $
  16.       YTITLE='real part of spectrum', $
  17.       XTITLE='Frequency in cycles / second', $
  18.       XRANGE=[-1,1]/(2*delt), XSTYLE=1, $
  19.       TITLE='Spectrum of u(k)'
  20.  
  21. PLOT, F, IMAGINARY(SHIFT(V,N/2-1)), $
  22.       YTITLE='imaginary part of spectrum', $
  23.       XTITLE='Frequency in cycles / second', $
  24.       XRANGE=[-1,1]/(2*delt), XSTYLE=1
  25.  
  26. !P.MULTI = 0
  27.  
  28.